<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>Tay计时程序</title>
		<script src="jquery/jquery-3.2.1.min.js"></script>

	</head>

	<body>

		<h1 id="aaa"></h1>
		<h1 id="bbb"></h1>
		<hr />
		<h3 id="ccc"></h3>

	</body>

</html>
<script>
	// ==============================================
	var times, nian, yue, ri, shi, fen, miao, shijianchuo;
	var js_aaa = document.getElementById("aaa");
	var js_bbb = document.getElementById("bbb");
	var js_ccc = document.getElementById("ccc");

	// ==============================================
	var times2 = new Date(Date.parse("2019-1-1 0:0"));
	var shijianchuo2 = times2.getTime();

	// ==============================================
	window.setInterval(function() {

		// 获取当前时间
		times = new Date();

		//年
		nian = times.getFullYear();
		//月
		yue = times.getMonth() + 1;
		//日
		ri = times.getDay();
		//时
		shi = times.getHours();
		//分
		fen = times.getMinutes();
		//秒
		miao = times.getSeconds();
		//时间戳
		shijianchuo = times.getTime();

		// 在页面显示时间
		js_aaa.innerHTML = "当前时间：" + nian + "年 " + yue + "月 " + ri + "日（ " + shi + "时 " + fen + "分 " + miao + "秒 ）";
		js_bbb.innerHTML = "当前时间戳：" + shijianchuo;
		js_ccc.innerHTML = "（2019年1月1日）时间戳：" + shijianchuo2;

	}, 1000);
</script>